package com.moxiao.yfjh.module.maker.dal.mysql.memberStringing;

import com.moxiao.yfjh.module.maker.controller.admin.memberStringing.vo.MatchmakerMemberStringingExportReqVO;
import com.moxiao.yfjh.module.maker.controller.admin.memberStringing.vo.MatchmakerMemberStringingPageReqVO;
import com.moxiao.yfjh.module.maker.dal.dataobject.memberStringing.MatchmakerMemberStringingDO;
import java.util.*;

import com.moxiao.yfjh.framework.common.pojo.PageResult;
import com.moxiao.yfjh.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.moxiao.yfjh.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;
import com.moxiao.yfjh.module.maker.controller.admin.memberStringing.vo.*;

/**
 * 相亲红娘会员用户牵线总次数 Mapper
 *
 * @author mx
 */
@Mapper
public interface MatchmakerMemberStringingMapper extends BaseMapperX<MatchmakerMemberStringingDO> {

    default PageResult<MatchmakerMemberStringingDO> selectPage(MatchmakerMemberStringingPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MatchmakerMemberStringingDO>()
                .eqIfPresent(MatchmakerMemberStringingDO::getNo, reqVO.getNo())
                .eqIfPresent(MatchmakerMemberStringingDO::getMatchmakerId, reqVO.getMatchmakerId())
                .eqIfPresent(MatchmakerMemberStringingDO::getMemberId, reqVO.getMemberId())
                .likeIfPresent(MatchmakerMemberStringingDO::getMemberName, reqVO.getMemberName())
                .eqIfPresent(MatchmakerMemberStringingDO::getStringingNum, reqVO.getStringingNum())
                .betweenIfPresent(MatchmakerMemberStringingDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MatchmakerMemberStringingDO::getId));
    }

    default List<MatchmakerMemberStringingDO> selectList(MatchmakerMemberStringingExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<MatchmakerMemberStringingDO>()
                .eqIfPresent(MatchmakerMemberStringingDO::getNo, reqVO.getNo())
                .eqIfPresent(MatchmakerMemberStringingDO::getMatchmakerId, reqVO.getMatchmakerId())
                .eqIfPresent(MatchmakerMemberStringingDO::getMemberId, reqVO.getMemberId())
                .likeIfPresent(MatchmakerMemberStringingDO::getMemberName, reqVO.getMemberName())
                .eqIfPresent(MatchmakerMemberStringingDO::getStringingNum, reqVO.getStringingNum())
                .betweenIfPresent(MatchmakerMemberStringingDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MatchmakerMemberStringingDO::getId));
    }

}
